/**
 * 
 */
package com.audi.adapter;

import com.audi.R;

import android.app.Activity;
import android.app.Dialog;
import android.view.View;
import android.view.Window;
import android.widget.TextView;
import android.widget.Toast;

/**
 * @author NamNT16
 * 
 */
public class RenameDeviceName {
	Activity activity;
	Dialog dialog;

	public RenameDeviceName(Activity activity) {
		this.activity = activity;
	}

	public void Rename_device() {
		dialog = new Dialog(activity);
		dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
		dialog.setContentView(R.layout.rename_device_dialog);
		TextView cancel = (TextView) dialog
				.findViewById(R.id.btn_rename_device_dialog_skip);
		TextView ok = (TextView) dialog
				.findViewById(R.id.btn_rename_device_dialog_ok);
		cancel.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				dialog.dismiss();
				Toast.makeText(activity.getApplicationContext(), "Cannel",
						Toast.LENGTH_SHORT).show();
			}
		});
		ok.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				dialog.dismiss();
				Toast.makeText(activity.getApplicationContext(), "Rename succesful",
						Toast.LENGTH_SHORT).show();
			}
		});

		dialog.show();

	}

}
